package com.imooc.girl.controller;

import com.imooc.girl.properties.GirlProperties;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;


@RestController
public class HelloController {

    @Autowired
    private GirlProperties girlProperties;

    @Value("${girl.cupSize}")
    private String cupSize;

    //@RequestMapping(value = "/hello", method = RequestMethod.GET)
    @GetMapping(value = "/hello")
    public String sayHello() {
        return cupSize + girlProperties.getCupSize() + girlProperties.getAge();
    }
}

// 1.命令行启动项目
// 2.mvn -install
// 3.java -jar target/girl-0.0.1-SNAPSHOT.jar --spring.profiles.active=prod
// 4.最后追加参数，代表读application-prod配置文件  --spring.profiles.active=prod